package com.future.direction.ui.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.future.direction.R;
import com.future.direction.data.bean.ClockInBean;

import java.util.List;

public class ClockInAdapter extends BaseQuickAdapter<ClockInBean, BaseViewHolder> {
    public ClockInAdapter(int layoutResId, @Nullable List<ClockInBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ClockInBean item) {
        switch (helper.getLayoutPosition()) {
            case 0:
                if (item.isClick()) {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_yellow_day1);
                } else {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_gray_day1);
                }
                break;
            case 1:
                if (item.isClick()) {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_yellow_day2);
                } else {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_gray_day2);
                }
                break;
            case 2:
                if (item.isClick()) {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_yellow_day3);
                } else {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_gray_day3);
                }
                break;
            case 3:
                if (item.isClick()) {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_yellow_day4);
                } else {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_gray_day4);
                }
                break;
            case 4:
                if (item.isClick()) {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_yellow_day5);
                } else {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_gray_day5);
                }
                break;
            case 5:
                if (item.isClick()) {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_yellow_day6);
                } else {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_gray_day6);
                }
                break;
            case 6:
                if (item.isClick()) {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_yellow_day7);
                } else {
                    helper.setImageResource(R.id.iv_tag, R.drawable.icon_clock_in_gray_day7);
                }
                break;
        }
    }
}
